package com.zb.excel.converter;

import com.zb.constant.CodeConstant;

import java.util.Date;

/**
 * 编码类型转换工具类
 * @Author WEN
 * @Date 2023/11/6 0006
 **/
public class CodeConverter {

    /**
     * 判断质保周期是否过保
     * @param status 编码状态
     * @param date 质保到期时间
     * @return
     */
    public static Integer codeStatusConverter(Integer status, Date date) {
        if (null == date) {
            return status;
        }
        if (status == CodeConstant.CODE_STATUS_2 && date.before(new Date())) {
            return CodeConstant.CODE_STATUS_3;
        }
        return status;
    }
}
